/*
 * @Author: yanjikun
 * @Date: 2022-01-04 11:52:07
 * @LastEditors: yanjikun
 * @LastEditTime: 2022-06-02 10:46:23
 * @Description: file content
 */
import { BasicTinymceProps } from '@/components/Tinymce'
import {
  CascaderProps,
  DatePickerProps,
  DividerProps,
  InputNumberProps,
  SelectProps,
  SwitchProps,
  TreeSelectProps,
  UploadProps,
} from 'ant-design-vue'
import { RangePickerProps } from 'ant-design-vue/lib/date-picker'
import { InputProps, TextAreaProps } from 'ant-design-vue/lib/input/inputProps'
import { RadioGroupProps } from 'ant-design-vue/lib/radio/Group'
import { RadioProps } from 'ant-design-vue/lib/radio/Radio'
import { CSSProperties } from 'vue'
import {
  AddressSelectProps,
  ApiSelectProps,
  ApiTreeSelectProps,
  IconsSelectProps,
} from './components'
type ColSpanType = number | string
export interface ColEx {
  style?: any
  /**
   * raster number of cells to occupy, 0 corresponds to display: none
   * @default none (0)
   * @type ColSpanType
   */
  span?: ColSpanType

  /**
   * raster order, used in flex layout mode
   * @default 0
   * @type ColSpanType
   */
  order?: ColSpanType

  /**
   * the layout fill of flex
   * @default none
   * @type ColSpanType
   */
  flex?: ColSpanType

  /**
   * the number of cells to offset Col from the left
   * @default 0
   * @type ColSpanType
   */
  offset?: ColSpanType

  /**
   * the number of cells that raster is moved to the right
   * @default 0
   * @type ColSpanType
   */
  push?: ColSpanType

  /**
   * the number of cells that raster is moved to the left
   * @default 0
   * @type ColSpanType
   */
  pull?: ColSpanType

  /**
   * <576px and also default setting, could be a span value or an object containing above props
   * @type { span: ColSpanType, offset: ColSpanType } | ColSpanType
   */
  xs?: { span: ColSpanType; offset: ColSpanType } | ColSpanType

  /**
   * ≥576px, could be a span value or an object containing above props
   * @type { span: ColSpanType, offset: ColSpanType } | ColSpanType
   */
  sm?: { span: ColSpanType; offset: ColSpanType } | ColSpanType

  /**
   * ≥768px, could be a span value or an object containing above props
   * @type { span: ColSpanType, offset: ColSpanType } | ColSpanType
   */
  md?: { span: ColSpanType; offset: ColSpanType } | ColSpanType

  /**
   * ≥992px, could be a span value or an object containing above props
   * @type { span: ColSpanType, offset: ColSpanType } | ColSpanType
   */
  lg?: { span: ColSpanType; offset: ColSpanType } | ColSpanType

  /**
   * ≥1200px, could be a span value or an object containing above props
   * @type { span: ColSpanType, offset: ColSpanType } | ColSpanType
   */
  xl?: { span: ColSpanType; offset: ColSpanType } | ColSpanType

  /**
   * ≥1600px, could be a span value or an object containing above props
   * @type { span: ColSpanType, offset: ColSpanType } | ColSpanType
   */
  xxl?: { span: ColSpanType; offset: ColSpanType } | ColSpanType
}

export type ComponentType =
  | 'Input'
  | 'InputNumber'
  | 'InputTextArea'
  | 'InputPassword'
  | 'InputSearch'
  | 'Divider'
  | 'Select'
  | 'ApiSelect'
  | 'Cascader'
  | 'Switch'
  | 'DatePicker'
  | 'Upload'
  | 'TreeSelect'
  | 'RadioGroup'
  | 'Radio'
  | 'RangePicker'
  | 'ApiTreeSelect'
  | 'IconsSelect'
  | 'AddressSelect'
  | 'Tinymce'

export type ComponentProps = (
  | InputProps
  | InputNumberProps
  | TextAreaProps
  | DividerProps
  | SelectProps
  | CascaderProps
  | SwitchProps
  | DatePickerProps
  | UploadProps
  | TreeSelectProps
  | RadioGroupProps
  | RadioProps
  | RangePickerProps
  | ApiSelectProps
  | ApiTreeSelectProps
  | IconsSelectProps
  | AddressSelectProps
  | BasicTinymceProps
) & {
  style?: CSSProperties
  /** 手动指定v-model绑定的key */
  vModelKey?: string
  [key: string]: any
}
